<extend name='Public/demo' />
<block name='search'>
<li>
	<form action="{:U('index')}" method="get" id="search_form">
		<input style="font-size:12px;" type="text" class="form-control search" placeholder="用户名" name="search_username" id="search_username" value="{$Think.get.search_username}">
	</form>
</li>
</block>

<block name='contents'>
	<style>
		.table tr,.table td, table th{
			text-align: center;
		}
	</style>
	<div class="row">
		<div class="col-lg-12">
			<section class="panel">
				<!-- <header class="panel-heading" style="text-align:center">用户列表</header> -->
				<div class="row">
					<div class="col-sm-12">
						<div id="sample_1_length" style="margin-top:10px;margin-left:10px">
							<label>
								<select size="1" name="prepage" aria-controls="sample_1" class="form-control" id="checkitem" form="search_form">
									<option value="5" <if condition="$Think.get.prepage eq 5">selected</if>>5</option>
									<option value="10" <if condition="$Think.get.prepage eq 10">selected</if>>10</option>
									<option value="20" <if condition="$Think.get.prepage eq 20">selected</if>>20</option>
									<option value="100" <if condition="$Think.get.prepage eq 100">selected</if>>100</option>
								</select>
							</label>
								条每页
							<label style="display:inline-block;margin-left:350px;font-size:22px;">用户列表</label>
						</div>
					</div>
				</div>
				<table class="table table-striped table-advance table-hover">
					<thead>
						<tr>
							<th> <i class="icon-location-arrow"></i>
								ID
							</th>
							<th> <i class="icon-bullhorn"></i>
								邮箱
							</th>
							<th class="hidden-phone">
								<i class="icon-question-sign"></i>
								上次登录时间
							</th>
							<th>
								<i class="icon-bookmark"></i>
								等级
							</th>
							<th>
								<i class=" icon-edit"></i>
								状态
							</th>
							<th>
								<i class="icon-upload-alt"></i>
								是否在线
							</th>
							<th>
								<i class=" icon-wrench"></i>
								操作
							</th>
						</tr>
					</thead>
					<tbody>
						<foreach name="res" item="vo" >
							<tr>
								<td>{$vo.user_id}</td>
								<td>{$vo.username}</td>
								<td class="hidden-phone"><if condition="empty($vo['lasttime'])">/<else />{$vo.lasttime|date="Y-m-d h:i:s",###}</if></td>
								<td>111</td>
								<td>
									<span class="label label-info label-mini">
										<if condition="$vo['lock'] lt 50">
											活跃
											<else />
											封号
										</if>
									</span>
								</td>
								<td>
									<span class="label label-success label-mini">{$vo['online']==1?'在线':'离线'}</span>
								</td>
								<td>
									<button class="btn btn-success btn-xs user_detail"  type="button"  data-toggle="modal" data-target="#exampleModal" data-whatever="@mdo">
										<i class="icon-ok"></i>
									</button>
									<a class="btn btn-primary btn-xs" href="{:U('edit', array('id'=>
										$vo['user_id']))}">
										<i class="icon-pencil"></i>
									</a>
									<a href="{:U('delete', array('user_id'=>$vo['user_id']))}" class="btn btn-danger btn-xs user_del">
										<i class="icon-trash "></i>
									</a>
								</td>
							</tr>
						</foreach>

					</tbody>
				</table>
			</section>
		</div>
	</div>




	<div class="row" style="margin-top:-10px">
		<!-- <div class="col-sm-4 col-sm-offset-1"> -->
			<!-- <div class="dataTables_info" id="dataTables-example_info" role="status" aria-live="polite" style="margin-top:7px;">共{$allpage}页,当前第{$p}页,本页显示{$rows}条记录,共{$total}条记录</div> -->
		<!-- </div> -->
		<style type="text/css">
					  #pages a,#pages span{ background-color: #fff;
							  border: 1px solid #ddd;
							  color: #337ab7;
							  float: left;
							  line-height: 1.42857;
							  margin-left: -1px;
							  padding: 6px 12px;
							  position: relative;
							  text-decoration: none;}
					  #pages span {
							background-color: #337ab7;
							border-color: #337ab7;
							color: #fff;
							cursor: default;
							z-index: 2;
							}
		</style>

		<div class="col-sm-12 pull-right" >
			<div class="dataTables_paginate paging_simple_numbers pull-right" id="dataTables-example_paginate">
				<div id="pages" style="margin-right:25px">{$pages}</div>
			</div>
			<div class="dataTables_info pull-right" id="dataTables-example_info" role="status" aria-live="polite" style="margin-top:0px;margin-right:20px;">共{$allpage}页,当前第<font color="red" size="5">{$p}</font>页,本页显示{$rows}条记录,共{$total}条记录</div>
		</div>
	</div>

	<div class="modal fade" id="exampleModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" style="width:100%">
		<div class="modal-dialog" role="document" >
			<div class="modal-content" style=""></div>
		</div>
	</div>
	<script>
			// 定义删除发送ajax的url提交页面的地址, 在index.js中可以使用
			  // var del_url = '{:U('delete')}';
			  var detail_url = '{:U('detail')}';
			  $('#checkitem').change(function(){
			  	$('#search_form').submit();
			  });

			</script>
	<script src="__PUBLIC__/Admin/User/index.js"></script>
</block>